public class Test {
    public static void main(String[] args) {
        BinaryTree binaryTree = new BinaryTree();
        BinaryTree.TreeNode root = binaryTree.createTree();
//        System.out.println(root.val);


        System.out.println("前序遍历：");
        binaryTree.preOrder(root);
        System.out.println();
        System.out.println("===============");
        System.out.println("中序遍历：");
        binaryTree.inOrder(root);
        System.out.println();
        System.out.println("===============");
        System.out.println("后序遍历：");
        binaryTree.postOrder(root);
        System.out.println();
        System.out.println("===============");
        System.out.println("该树节点个数（方法一）：");
        binaryTree.size(root);
        System.out.println(BinaryTree.nodeSize);
        System.out.println("该树节点个数（方法二）：");
        System.out.println(binaryTree.size2(root));

        System.out.println("该树的叶子节点（方法一）：");
        binaryTree.getLeafNodeCount(root);
        System.out.println(BinaryTree.leafNodeCount);

        System.out.println("该树的叶子节点（方法二）：");
        System.out.println(binaryTree.getLeafNodeCount2(root));

        System.out.println("取第K层节点的个数（子问题思路）：");
        System.out.println(binaryTree.getKLevelNodeCount(root,3));

        System.out.println("二叉树的高度（子问题思路）：");
        System.out.println(binaryTree.getHeight(root));

        System.out.println("检测值为value的元素是否存在");
        BinaryTree.TreeNode ret = binaryTree.find(root, 'A');
        System.out.println(ret.val);

        System.out.println("层序遍历：");
        binaryTree.levelOrder(root);
        System.out.println();
        System.out.println("判断一棵树是不是完全二叉树");
        System.out.println(binaryTree.isCompleteTree(root));
    }
}
